package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_BranchCompanyStaff 分公司员工
 *
 */
public class TestData_TB_BranchCompanyStaff
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_BranchCompanyStaff saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_User user
	,bairui.international.model.domain.jpa.TB_BranchCompany branchCompany
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_BranchCompanyStaff");
		return (TB_BranchCompanyStaff)repository.save(newMust(
				user
				,branchCompany
			));
	}
	
	public static TB_BranchCompanyStaff newMust(
		bairui.international.model.domain.jpa.TB_User user
	,bairui.international.model.domain.jpa.TB_BranchCompany branchCompany
	){
		return new TB_BranchCompanyStaff(new TB_BranchCompanyStaff.MustProperties() {
			/** 用户 */
			@Override public bairui.international.model.domain.jpa.TB_User getUser(){
				return user;
			}
			/** 分公司 */
			@Override public bairui.international.model.domain.jpa.TB_BranchCompany getBranchCompany(){
				return branchCompany;
			}
			/** 负责人标志 */
			@Override public Boolean getDirectorFlag(){
				return new java.util.Random().nextBoolean();
			}
			/** 激活中标志 */
			@Override public Boolean getActiveFlag(){
				return new java.util.Random().nextBoolean();
			}
			/** 总金额 */
			@Override public Double getMoney(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
			/** 可提现总金额 */
			@Override public Double getWithdrawMoney(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_BranchCompanyStaff saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_User user
	,bairui.international.model.domain.jpa.TB_BranchCompany branchCompany
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaff prev
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_BranchCompanyStaff");
		return (TB_BranchCompanyStaff)repository.save(newAll(
				user
				,branchCompany
				,prev
			));
	}
	
	public static TB_BranchCompanyStaff newAll(
		bairui.international.model.domain.jpa.TB_User user
	,bairui.international.model.domain.jpa.TB_BranchCompany branchCompany
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaff prev
	){
		return new TB_BranchCompanyStaff(
			new TB_BranchCompanyStaff.MustProperties() {
				/** 用户 */
				@Override public bairui.international.model.domain.jpa.TB_User getUser(){
					return user;
				}
				/** 分公司 */
				@Override public bairui.international.model.domain.jpa.TB_BranchCompany getBranchCompany(){
					return branchCompany;
				}
				/** 负责人标志 */
				@Override public Boolean getDirectorFlag(){
					return new java.util.Random().nextBoolean();
				}
				/** 激活中标志 */
				@Override public Boolean getActiveFlag(){
					return new java.util.Random().nextBoolean();
				}
				/** 总金额 */
				@Override public Double getMoney(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
				/** 可提现总金额 */
				@Override public Double getWithdrawMoney(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
			},
			new TB_BranchCompanyStaff.OptionalSingleProperties() {
				/** 上级 */
				@Override public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getPrev(){
					return prev;
				}
				/** 二维码 */
				@Override public String getDimensionalUrl(){
					return Generator.generate(0, 255);
				}
			}
		);
	}
	

}
